package com.cmcc.pp.ui.gatewayadministration;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cmcc.pp.R;
import com.cmcc.pp.base.BActivity;
import com.zrspring.libv2.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by ABC on 2017/12/20.
 * 网关详情
 */

public class GatewayDetailsActivity extends BActivity {

    @Bind(R.id.details_relat_morewaring)
    RelativeLayout detailsRelatMorewaring;
    @Bind(R.id.gateway_rela_moreinfo)
    RelativeLayout gatewayRelaMoreinfo;
    @Bind(R.id.gatewaydetails_but_linediagnosis)
    RelativeLayout gatewayDetailsButlinediagnosis;
    @Bind(R.id.gatewaydetails_relat_pingdiagnosis)
    RelativeLayout gatewaydetails_relat_pingdiagnosis;
    @Bind(R.id.gatewaydetails_relat_tracediagnosis)
    RelativeLayout gatewaydetails_relat_tracediagnosis;


    @Override
    protected boolean getHasTitle() {
        return true;
    }

    @Override
    public int getContentLayoutId() {
        return R.layout.activity_gatewaydetails;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        getHeader().setTitle(R.string.str_gatewaydetails);
    }

    @Override
    public void loadData() {

    }

    @OnClick({
            R.id.details_relat_morewaring,
            R.id.gateway_rela_moreinfo,
            R.id.gatewaydetails_but_linediagnosis,
            R.id.gatewaydetails_relat_pingdiagnosis,
            R.id.gatewaydetails_relat_tracediagnosis

    })
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.details_relat_morewaring:
                openWaring();
                break;
            case R.id.gateway_rela_moreinfo:
                openMoreInfo();
                break;
            case R.id.gatewaydetails_but_linediagnosis:
                openLineDiagnosis();
                break;
            case R.id.gatewaydetails_relat_pingdiagnosis:
                openPingdiagnosis();
                break;
            case R.id.gatewaydetails_relat_tracediagnosis:
                openTraceDiagnosis();
                break;
        }
    }

    //Traceroute诊断
    private void openTraceDiagnosis() {
        Intent traceIntent = new Intent(this,TracerouteDiagnosisActivity.class);
        startActivity(traceIntent);
    }

    //Ping诊断
    private void openPingdiagnosis() {
        Intent lineIntent = new Intent(this,PingDiagnosisActivity.class);
        startActivity(lineIntent);
    }

    //线路诊断
    private void openLineDiagnosis() {
        Intent lineIntent = new Intent(this,LineDiagnosisActivity.class);
        startActivity(lineIntent);
    }

    //更多信息
    private void openMoreInfo() {
        Intent moreIntent = new Intent(this,MoreInformationForGateway.class);
        startActivity(moreIntent);
    }

    //告警信息
    private void openWaring() {
        Intent warIntent = new Intent(this,WarningMessageActivity.class);
        startActivity(warIntent);
    }

}
